/**
 * 
 */
package database;

import java.sql.*;

/**
 * @author Kevin Hanson
 * 
 */
public class Database {
	private static boolean initialized = false;
	private static Connection conn = null;
	//private static Statement stat = null;

	public Database() throws Exception {
		if (initialized == false) {
			init();
		}
	}

	private void init() throws Exception {
		initialized = true;
		Class.forName("org.sqlite.JDBC");
		conn = DriverManager.getConnection("jdbc:sqlite:tmp.db");
		//stat = conn.createStatement();
	}
}
/*
public class PDA {
  public static void main(String[] args) throws Exception {
	    stat.executeUpdate("drop table if exists people;");
	    stat.executeUpdate("create table people (name, occupation);");

	    prep.setString(1, "Gandhi");
	    prep.setString(2, "politics");
	    prep.addBatch();
	    prep.setString(1, "Turing");
	    prep.setString(2, "computers");
	    prep.addBatch();
	    prep.setString(1, "Wittgenstein");
	    prep.setString(2, "smartypants");
	    prep.addBatch();

	    conn.setAutoCommit(false);
	    prep.executeBatch();
	    conn.setAutoCommit(true);

	    ResultSet rs = stat.executeQuery("select * from people;");
	    while (rs.next()) {
	      System.out.println("name = " + rs.getString("name"));
	      System.out.println("job = " + rs.getString("occupation"));
	    }
	    rs.close();
	    conn.close();
	  }
}
*/